
package ws;

import java.util.Date;


public class DateModifier {
    
        public static String getModifiedDateString(Date date){
        String month = null;
        String hour = null;
        String day = null;
        String minute = null;
        int monthint = date.getMonth() + 1;
        int yearint = date.getYear() + 1900;
        if (monthint < 10) {
            month = "0" + monthint;
        } else {
            month = "" + monthint;
        }

        if (date.getDate() < 10) {
            day = "0" + date.getDate();
        } else {
            day = "" + date.getDate();
        }


        if (date.getHours() < 10) {
            hour = "0" + date.getHours();
        } else {
            hour = "" + date.getHours();
        }
        
        if (date.getMinutes() < 10) {
            minute = "0" + date.getMinutes();
        } else {
            minute = "" + date.getMinutes();
        }
        String string = new String("" + yearint + "-" + month +"-" + day + " " + hour + ":" + minute);
        return string;
    }
    
}
